/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lifecare;

import java.util.PriorityQueue;

/**
 *
 * @author TQNINH
 */
public class AppointDoctor {
    
    
    public AppointDoctor() {
        
    }
    
    public static void main(String[] args) {
        PriorityQueue pq = new PriorityQueue();
        Doctor Cardiologist = new Doctor("Casuality", 1);
        Doctor Gynecologist = new Doctor("Surgery", 2);
        Doctor Paediatric = new Doctor("Routine Chek-up", 3);
        
        pq.offer(Cardiologist);
        pq.offer(Gynecologist);
        pq.offer(Paediatric);
        
        while(!pq.isEmpty()) {
            System.out.println("\nAppointing doctors based on their priorities:");
            System.out.print("********************************************");
            Doctor doctor = ((Doctor)pq.remove());
            System.out.println(doctor.toString());
        }
    }
}
